package lab02.Text30;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created by Administrator on 2017/11/7.
 */
public class Text {
    static double average;
    public static void main(String[] args) {
        double markin;
        Scanner scanner=new Scanner(System.in);
        List<Double> marks=new ArrayList<Double>();
        do {
            System.out.println("请输入一名学生的成绩：");
            markin=scanner.nextDouble();
            marks.add(markin);
        }
        while(markin>1);
        int index=marks.size()-1;
        marks.remove(index);
        for(int i = 0; i<index; i++){
            average = marks.get(i) / index;
        }
        System.out.println(index+"名学生成绩的平均分为："+average);
    }
}
